/*
 * <Pezad Platformer>
 * Copyright 2008 Shayne Riley
 * 
 * This file is part of <Pezad Platformer>.
 * 
 * <Pezad Platformer> is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * <Pezad Platformer> is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with <Pezad Platformer>.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * To contact the authors on questions or issues regarding the license,
 * you may send an email to <shayner@gmail.com> or write to
 * Shayne Riley / P.O. Box 1092 / McCook, NE 69001.
 */

#ifndef NETWORKSYSTEM_H_
#define NETWORKSYSTEM_H_

namespace pzdNetwork
{

//! Network sub-system.
/**
 * Once used, spawns a thread used for all networking communication. Everything
 * is self-contained, meaining the client has no methods that can be used on
 * this system.
 * 
 * To use the network system, use Network, the safe interface for the
 * sub-system.    
 */
class NetworkSystem
{
    public:
    	//! Starts the sub-system, if it is not started already.
    	/**
    	 * The sub-system is completely and internally managed. This
    	 * is the only function that needs to be called.
    	 */
    	static void start();
    private:
    	//! Constructor for the network sub-system.
    	/**
    	 * There should only be one network-subsystem. Making the constructor
    	 * private ensures this happens.
    	 */
        NetworkSystem();

        //! Destructor for a class that will never be derived from.
        ~NetworkSystem();

        //! Does all the initialization for the class.
        void init();

        //! Does all the cleaning up and such for the class.
        void finalize();

        //! No copying needed, do not allow. Copy ctor declared, not defined.
        NetworkSystem(const NetworkSystem& rhs);        
        //! No assignment needed. Do not define this function.
        NetworkSystem& operator=(const NetworkSystem rhs);
        //! No address-of needed. Do not define this function.
        NetworkSystem* operator&();
        //! No const address-of needed. Do not define this function.
        const NetworkSystem* operator&() const;
};

} // namespace

#endif /*NETWORKSYSTEM_H_*/
